<extend name="Public/base" />

<block name="body">
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>订单列表</h2>
	</div>
	<div class="cf">
		<div class="fl">
            <button class="btn document_add" url="{:U('add')}">新 增</button>
            <button class="btn ajax-post" target-form="ids" url="{:U("setStatus",array("status"=>1))}">改成已付款</button>
            <button class="btn ajax-post" target-form="ids" url="{:U("setStatus",array("status"=>0))}">改成未付款</button>
            <button class="btn ajax-post" target-form="ids" url="{:U("setStatus",array("status"=>2))}">改成已生成保单</button>
            <button class="btn ajax-post confirm" target-form="ids" url="{:U("setStatus",array("status"=>-1))}">删 除</button>
        </div>
        <div class="search-form fr cf">
            <div class="sleft">
                <input type="text" name="title" class="search-input" value="{:I('title')}" placeholder="请输入标题文档">
                <a class="sch-btn" href="javascript:;" id="search" url="{:U('Order/index')}"><i class="btn-search"></i></a>
            </div>
            <div class="btn-group-click adv-sch-pannel fl">
                <button class="btn">高 级<i class="btn-arrowdown"></i></button>
                <div class="dropdown cf">
                    <div class="row">
                        <label>订单时间：</label>
                        <input type="text" id="time-start" name="time-start" class="text input-2x" value="" placeholder="起始时间" /> -
                        <input type="text" id="time-end" name="time-end" class="text input-2x" value="" placeholder="结束时间" />
                    </div>
                </div>
            </div>
        </div>

    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
	<table class="">
    <thead>
        <tr>
		<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
		<th class="">订单号</th>
		<th class="">车牌号码</th>
		<th class="">订单日期</th>
		<th class="">保单起始日期</th>
		<th class="">保单结束日期</th>
        <th class="">商业险</th>
        <th class="">交强险</th>
        <th class="">车船税</th>
        <th class="">状态</th>
		<th class="">操作</th>
		</tr>
    </thead>
    <tbody>
		<notempty name="_list">
		<volist name="_list" id="vo">
		<tr>
            <td><input class="ids" type="checkbox" name="id[]" value="{$vo.order_id}" /></td>
            <td><a href="{:U('Order/detail',array('id'=>$vo['order_id']))}">{$vo.order_no}</a></td>
			<td>{$vo.car_no}</td>
			<td>{$vo.posttime}</td>
			<td>{$vo.start_date}</td>
            <td>{$vo.end_date}</td>
			<td>￥{$vo.n_real_amt|default=0}</td>
            <td>￥{$vo.n_traff_real_prm|default=0}</td>
            <td>￥{$vo.n_tax_real_prm|default=0}</td>
            <td>{$vo.status_text}</td>
			<td>
                <a href="{:U('Order/del',array('id'=>$vo['order_id']))}" class="confirm ajax-get">彻底删除</a>
                </td>
		</tr>
		</volist>
		<else/>
		<td colspan="10" class="text-center"> aOh! 暂时还没有内容! </td>
		</notempty>
	</tbody>
    </table>
	</div>
    <div class="page">
        {$_page}
    </div>
</block>

<block name="script">
	<script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>

	<script type="text/javascript">
	//搜索功能
	$("#search").click(function(){
        var url = $(this).attr('url');
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
        window.location.href = url;
	});
    $(".search-form").find(".drop-down").hover(function(){
        $("#sub-sch-menu").removeClass("hidden");
    },function(){
        $("#sub-sch-menu").addClass("hidden");
    });
    $("#sub-sch-menu li").find("a").each(function(){
        $(this).click(function(){
            var text = $(this).text();
            $("#sch-sort-txt").text(text).attr("data",$(this).attr("value"));
            $("#sub-sch-menu").addClass("hidden");
        })
    });
	//回车搜索
	$(".search-input").keyup(function(e){
		if(e.keyCode === 13){
			$("#search").click();
			return false;
		}
	});
    //导航高亮
    highlight_subnav('{:U('Order/recycle')}');
	</script>
</block>
